package com.meij.adapter;

import java.util.ArrayList;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.meij.bean.Album;
import com.meij.fragment.PicFragment;

public class PicPagerAdapter extends FragmentPagerAdapter {
	private ArrayList<Album> albums = new ArrayList<Album>();

	public PicPagerAdapter(FragmentManager fm, ArrayList<Album> albums) {
		super(fm);
		this.albums = albums;
	}

	@Override
	public Fragment getItem(int position) {
		Album album = albums.get(position);
		return PicFragment.newInstance(album);
	}

	@Override
	public int getCount() {
		return albums.size();
	}
}